package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.SetmealService;
import com.sky.vo.SetmealVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TODO
 *
 * @Author Yjr
 * @Date 2025/5/21 9:52
 */
@RestController("userSetmealController")
@RequestMapping("/user/setmeal")
@Slf4j
@Api
public class SetmealController {
    @Autowired
    private SetmealService setmealService;
    /**
     * 根据分类套餐
     * @param categoryId
     * @return
     */
    @ApiOperation("根据分类套餐")
    @GetMapping("/list")
    public Result findByCategoryId(@RequestParam Integer categoryId){
        List<SetmealVO> setmealVOList= setmealService.findByCategoryId(categoryId);

        return Result.success(setmealVOList);
    }

}
